package net.qiqbframework.modelling.domain;

import net.qiqbframework.common.ImmutableException;

/**
 * 找不到对应的聚合对象异常。
 */
public class AggregateNotFoundException extends ImmutableException {

    private final String aggregateIdentifier;

    public AggregateNotFoundException(String aggregateIdentifier, String message) {
        super(message);
        this.aggregateIdentifier = aggregateIdentifier;
    }

    public AggregateNotFoundException(String aggregateIdentifier, String message, Throwable cause) {
        super(message, cause);
        this.aggregateIdentifier = aggregateIdentifier;
    }

    public Object getAggregateIdentifier() {
        return aggregateIdentifier;
    }
}
